<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

function smarty_block_news($params, $tagdata, $smarty, $repeat){
	if (!isset($params['category_id'])){
		exit();
	}else{
		$smarty->CI->load->model('news/news_model');
		$news = $smarty->CI->news_model->get_news(array('category_id'=>$params['category_id'],'limit'=>5,'status'=>1));
		if ($news){
			$smarty->assign('news',$news);
		}
	}
	echo $tagdata;
}
